.file-list-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box; /* 确保边框不会增加额外高度 */
}

.file-list-container .ant-table-wrapper {
  flex: 1;
  overflow: hidden;
}

.file-list-container .ant-table {
  height: 100%;
  table-layout: fixed; /* 关键：固定表格布局，允许列宽调整 */
}

.file-list-container .ant-table-container {
  height: 100%;
}

.file-list-container .ant-table-header {
  overflow: hidden !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.file-list-container .ant-table-body {
  overflow-y: auto !important;
  overflow-x: auto !important;
}

/* 关键修复：确保Ant Design内部容器占满高度 */
.file-list-container .ant-spin-container {
  height: 100% !important;
}

.file-list-container .ant-spin-nested-loading {
  height: 100% !important;
}

/* 浮动滚动条样式 - 鼠标悬停时显示 */
.file-list-container .ant-table-body {
  /* 默认隐藏滚动条 */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.file-list-container .ant-table-body::-webkit-scrollbar {
  width: 0px; /* 默认隐藏 */
  height: 0px;
  transition: width 0.2s ease, height 0.2s ease;
}

/* 鼠标悬停时显示滚动条 */
.file-list-container:hover .ant-table-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.file-list-container .ant-table-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  transition: background 0.2s ease;
}

.file-list-container .ant-table-body::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.5);
}

.file-list-container .ant-table-body::-webkit-scrollbar-track {
  background: transparent;
}

.file-list-container .ant-table-body::-webkit-scrollbar-corner {
  background: transparent;
}

/* 调整表头样式 */
.file-list-container .ant-table-thead > tr > th {
  padding: 4px 8px !important;
  background: #fafafa !important;
  font-weight: 500 !important;
  font-size: 11px !important;
  user-select: none;
  position: relative; /* 为列宽调整手柄提供定位基准 */
  height: 26px !important; /* 减少表头高度 */
  line-height: 18px !important; /* 设置表头行高 */
}

/* 覆盖Ant Design的small表格表头样式 */
.file-list-container .ant-table-small .ant-table-thead > tr > th {
  padding: 4px 8px !important;
  height: 26px !important;
  line-height: 18px !important;
  font-size: 11px !important;
}

/* 禁用列宽调整 */
.file-list-container .ant-table-thead > tr > th.ant-table-cell {
  resize: none !important;
}

/* 调整单元格内容样式 */
.file-list-container .ant-table-tbody > tr > td {
  padding: 2px 8px !important;
  font-size: 11px !important;
  cursor: default !important;  /* 强制使用默认鼠标样式 */
  height: 24px !important; /* 减少行高 */
  line-height: 20px !important; /* 设置行高 */
}

/* 覆盖Ant Design的small表格样式 */
.file-list-container .ant-table-small .ant-table-tbody > tr > td {
  padding: 2px 8px !important;
  height: 24px !important;
  line-height: 20px !important;
}

/* 覆盖Ant Design的表格标题样式 */
.file-list-container .ant-table-small .ant-table-title,
.file-list-container .ant-table-small .ant-table-footer {
  padding: 2px 8px !important;
}

/* 确保表格行高度一致 */
.file-list-container .ant-table-tbody > tr {
  height: 24px !important;
}

/* 设置表格行的鼠标样式 */
.file-list-container .ant-table-tbody > tr {
  cursor: default;  /* 使用默认鼠标样式 */
}

/* 设置单元格内容的鼠标样式 */
.file-list-container .ant-table-tbody > tr > td .ant-table-cell-content {
  cursor: default;  /* 使用默认鼠标样式 */
}

/* 文件名单元格样式 */
.file-list-container .file-list-name-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.file-list-container .file-list-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 文件图标样式 */
.file-list-container .file-list-icon {
  font-size: 14px;
  min-width: 18px;
  text-align: center;
}

/* 加载状态样式 */
.file-list-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.file-list-loading .ant-spin {
  margin: 20px 0;
}

/* 文件图标悬停效果 */
.file-list-container .file-list-name-cell:hover .file-list-icon {
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

/* 文件打开loading状态样式 */
.file-list-container .file-list-name-cell .ant-spin {
  color: #1890ff;
}

.file-list-container .file-list-name-cell .ant-spin .anticon {
  color: #1890ff;
}

/* 新上传文件高亮样式 */
.file-list-container .file-list-highlighted {
  background: linear-gradient(90deg, #e6f7ff, #bae7ff);
  border-radius: 4px;
  padding: 2px 4px;
  animation: highlight-fade 3s ease-out;
}

.file-list-container .file-list-row-highlighted {
  background-color: #e6f7ff !important;
  animation: row-highlight-fade 3s ease-out;
}

@keyframes highlight-fade {
  0% {
    background: linear-gradient(90deg, #52c41a, #95de64);
    box-shadow: 0 0 8px rgba(82, 196, 26, 0.5);
  }
  50% {
    background: linear-gradient(90deg, #e6f7ff, #bae7ff);
    box-shadow: 0 0 4px rgba(24, 144, 255, 0.3);
  }
  100% {
    background: transparent;
    box-shadow: none;
  }
}

@keyframes row-highlight-fade {
  0% {
    background-color: #f6ffed !important;
    box-shadow: inset 3px 0 0 #52c41a;
  }
  50% {
    background-color: #e6f7ff !important;
    box-shadow: inset 3px 0 0 #1890ff;
  }
  100% {
    background-color: transparent !important;
    box-shadow: none;
  }
}

/* 列宽调整手柄样式 */
.file-list-resize-handle {
  position: absolute;
  right: -2px;
  top: 0;
  bottom: 0;
  width: 4px;
  cursor: col-resize;
  background: transparent;
  z-index: 1;
  transition: background-color 0.2s ease;
}

.file-list-resize-handle:hover {
  background: #1890ff;
}

/* 调整手柄在表头右边缘的样式 */
.file-list-container .ant-table-thead > tr > th:hover .file-list-resize-handle {
  background: rgba(24, 144, 255, 0.3);
}

/* 调整过程中的视觉反馈 */
.file-list-container .ant-table-thead > tr > th.resizing {
  background-color: #f0f8ff;
}

/* 确保调整手柄在最右侧列也能正常显示 */
.file-list-container .ant-table-thead > tr > th:last-child .file-list-resize-handle {
  display: none;
}

/* 外层滚动容器中的表格使用自动布局 */
.file-list-scroll-container .ant-table-content table {
  table-layout: auto !important; /* 使用自动布局支持横向滚动 */
  /* 移除 width: 100% !important，让JavaScript控制表格宽度 */
}

/* 非滚动容器中的表格保持固定布局 */
.file-list-container:not(.file-list-scroll-container) .ant-table-content table {
  table-layout: fixed !important;
}

/* 移除冲突的CSS变量规则 */
/* 注释掉这些规则，因为它们与我们的动态宽度设置冲突 */
/*
.file-list-container .ant-table-thead > tr > th,
.file-list-container .ant-table-tbody > tr > td {
  width: var(--column-width) !important;
  min-width: var(--column-width) !important;
  max-width: var(--column-width) !important;
}
*/

/* 重要：让表头响应内联样式 */
.file-list-container .ant-table-thead > tr > th {
  overflow: visible !important; /* 允许调整手柄超出边界 */
  min-width: 50px !important; /* 设置最小宽度 */
  position: relative; /* 为调整手柄提供定位基准 */
  /* 移除所有可能覆盖width的CSS规则，让内联样式生效 */
}

/* 复选框列特殊样式 */
.file-list-container .ant-table-thead > tr > th.ant-table-selection-column,
.file-list-container .ant-table-tbody > tr > td.ant-table-selection-column {
  width: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  padding: 4px 8px !important;
  text-align: center !important;
}

/* 强制隐藏滚动条占位列 - 表头和表体 */
.file-list-container .ant-table-thead > tr > th.ant-table-cell-scrollbar,
.file-list-container .ant-table-tbody > tr > td.ant-table-cell-scrollbar {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* 强制隐藏所有滚动条相关的列 */
.file-list-container th[class*="scrollbar"],
.file-list-container td[class*="scrollbar"] {
  display: none !important;
}

/* 外层滚动容器样式 */
.file-list-scroll-container {
  position: relative;
}

.file-list-scroll-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.file-list-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.file-list-scroll-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.5);
}

.file-list-scroll-container::-webkit-scrollbar-track {
  background: #f0f0f0;
}

/* 外层滚动时表头固定 */
.file-list-scroll-container .ant-table-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
  background: #fff !important;
}

/* 禁用表格内部滚动 */
.file-list-scroll-container .ant-table-body {
  overflow: visible !important;
  height: auto !important;
}

/* 确保表格有最小宽度，支持横向滚动 */
.file-list-scroll-container .ant-table {
  min-width: max-content; /* 表格最小宽度为内容宽度 */
  width: auto !important; /* 允许表格自动调整宽度 */
}

.file-list-scroll-container .ant-table-wrapper {
  width: auto !important; /* 允许包装器自动调整宽度 */
  min-width: max-content;
}

.file-list-scroll-container .ant-table-container {
  width: auto !important; /* 允许容器自动调整宽度 */
  min-width: max-content;
}

.file-list-scroll-container .ant-table-content {
  width: auto !important; /* 允许内容区域自动调整宽度 */
  min-width: max-content;
}

.file-list-scroll-container .ant-table-content table {
  min-width: max-content; /* 确保table元素也有最小宽度 */
  width: auto !important; /* 移除固定宽度限制 */
}

/* 确保单元格内容不会撑开列宽，但允许调整 */
.file-list-container .ant-table-tbody > tr > td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 50px !important;
  /* 移除 max-width: none，让列宽受JavaScript控制 */
}

/* 重要：确保调整手柄可以正常工作 */
.file-list-container .ant-table-thead > tr > th .file-list-resize-handle {
  position: absolute !important;
  right: -2px !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 4px !important;
  cursor: col-resize !important;
  z-index: 999 !important; /* 确保在最上层 */
  background: transparent !important; /* 默认透明，不要一直显示蓝色 */
}

/* 调整时的视觉反馈 */
.file-list-container .ant-table-thead > tr > th .file-list-resize-handle:hover {
  background: rgba(24, 144, 255, 0.5) !important;
}

/* 原生实现的调整手柄样式 */
.file-list-resize-handle-native {
  transition: background-color 0.2s ease;
}

.file-list-resize-handle-native:hover {
  background: rgba(24, 144, 255, 0.5) !important;
}

/* 表头悬停时显示手柄 */
.file-list-container .ant-table-thead > tr > th:hover .file-list-resize-handle-native {
  background: rgba(24, 144, 255, 0.3) !important;
}

/* 剪切文件的视觉反馈样式 */
.file-list-container .file-list-row-cut {
  opacity: 0.5 !important;
  background-color: #fff2e8 !important;
  border: 1px dashed #ff7a00 !important;
  position: relative;
}

.file-list-container .file-list-row-cut::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 4px,
    rgba(255, 122, 0, 0.1) 4px,
    rgba(255, 122, 0, 0.1) 8px
  );
  pointer-events: none;
  z-index: 1;
}

.file-list-container .file-list-row-cut .file-list-name {
  text-decoration: line-through;
  color: #ff7a00;
}

.file-list-container .file-list-row-cut .file-list-icon {
  opacity: 0.6;
  filter: grayscale(30%);
}

/* 复制粘贴进度对话框样式 */
.copy-paste-progress-modal .ant-modal-body {
  padding: 24px;
}

.copy-paste-progress-content {
  text-align: center;
}

.copy-paste-progress-content .ant-progress {
  margin: 16px 0;
}

.copy-paste-progress-info {
  margin-top: 12px;
  color: #666;
  font-size: 12px;
}

.copy-paste-progress-file {
  margin: 8px 0;
  font-weight: 500;
  color: #1890ff;
}

.copy-paste-progress-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: #999;
}

/* 剪贴板状态提示样式 */
.clipboard-status-tip {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 9999;
  animation: clipboard-tip-fade 2s ease-out;
}

@keyframes clipboard-tip-fade {
  0% {
    opacity: 0;
    transform: translateX(100%);
  }
  10% {
    opacity: 1;
    transform: translateX(0);
  }
  90% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* 确保测量行真正不占用视觉空间 - 不破坏表格功能 */
.file-list-container .ant-table-measure-row {
  height: 0 !important;
  line-height: 0 !important;
  font-size: 0 !important;
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
  top: -1px !important;
  visibility: hidden !important;
}

.file-list-container .ant-table-measure-row td {
  height: 0 !important;
  line-height: 0 !important;
  font-size: 0 !important;
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.file-list-container .ant-table-measure-row td div {
  height: 0 !important;
  line-height: 0 !important;
  font-size: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}